This is the replication folder for the BJPS paper titled, "The Importance of Breaking Even: How Local Constituency Benefits and Social Welfare Returns Make Politically Feasible Policies".

To reproduce the analysis, download the contents into a folder and then click "Replication.Rproj" to automatically set the working directory to this folder.

There are three main R scripts: 01_wrangling.R, 02_maintables-figures.R, and 03_appendixtables-figures.R and two function scripts: make_texreg.R and make_kable.R.

01_wrangling.R is the cleaning script that turns the raw data into 4 RData files for the 4 experiments: cleaned_exp1.RData, cleaned_expR1.RData, cleaned_expR2.RData, and cleaned_exp2.RData.

NOTE: This script is present to show that it is clear how we cleaned and preprocessed the data. You will not be able to run 01_wrangling.R because we have not uploaded the raw, potentially identifiable, data.

02_maintables-figures.R takes the 4 cleaned datasets and makes the tables and figures in the main paper. The default code will create a folder called "output" in the working directory and deposit all of the figures and tables in there, unless you replace the "save_path" variable with your own file path. 

03_appendixtables-figures.R does the same, except for the Supplemental MATERIALS. 

"make_texreg.R" is a wrapper function for producing Latex-ready regression tables. "make_kable.R" is a wrapper function for producing Latex-ready general tables.

